#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QNetworkInterface>//网络信息
#include <QHostAddress>//ip地址
#include <QTcpServer> //tcp协议
#include <QTcpSocket> //socket套接字
#include <QDebug>
#include "class.h" //用户类头文件

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(User &user,QTcpSocket *socket,QString &friendname,QWidget *parent = nullptr);
    ~MainWindow();


private slots:
    void on_pushButton_shuaxin_clicked();
    void onAnchorClicked(const QUrl &url);  // 处理链接点击的槽函数

    void on_pushButton_send_text_clicked();

    void on_pushButton_send_file_clicked();

private:
    Ui::MainWindow *ui;
    User user;
    QTcpSocket *socket;
    QString mainpath;
    QString friendname;
    QString text_path;
    QString video_path;
    QString audio_path;
    QString image_path;
    QString file_path;
    QString textfile;

};
#endif // MAINWINDOW_H
